# 作者： 李泉志
# 2025年01月06日21时25分秒
# 2947029073@qq.com

def innner_func():
    dict1 = {'a': 1, 'b': 2, 'c': 3}
    print(len(dict1))
    print(max(dict1))  # 如果是字典，只针对 key 比较，一般不用于字典，集合一般也不用 max
    print(min(dict1))
    del dict1['b']
    print(dict1)

    list1 = [1, 2, 3, 4, 5]
    print(len(list1))
    print(max(list1))
    print(min(list1))
    del list1[1]
    print(list1)


def slice_list():
    test_list = [1, 2, 3, 4, 5, 6]
    print(test_list[3:3])  # []
    test_list[3:3] = ['x', 'y', 'z']
    print(test_list)  # [1, 2, 3, 'x', 'y', 'z', 4, 5, 6]
    test_list[3:4] = ['66']
    print(test_list)  # [1, 2, 3, '66', 'y', 'z', 4, 5, 6]


def use_method():
    a = (1, 2, 3)
    b = ('a', 'b', 'c')
    print(list(zip(a, b)))
    print(dict(zip(a, b)))

    # 使用enumerate
    season = ['Spring', 'Summer', 'Fall', 'Winter']
    list2 = list(enumerate(season))
    print('list2:', list2)
    print('dict list2', dict(list2))

    dict1 = dict(enumerate(season))
    print('dict1:', dict1)
    print({k: v for k, v in dict(list2).items()})  # k为键    ，v为值


if __name__ == '__main__':
    # innner_func()
    # slice_list()
    use_method()
